# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pathlib2
pkgname=('python2-pathlib2' 'python-pathlib2')
_pkgname=pathlib2
pkgver=2.3.7.post1
pkgrel=4
pkgdesc='Object-oriented filesystem paths.'
url='https://pypi.org/project/pathlib2/#files'
arch=('any')
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('bcca982f2b45311e01cd906a94ed7108d10276b703587e8f39fd4127b92b0f5cdf00053ca96e77eca3c8ab12cc06658ed1855b3517a7012de5ececc0519b532d')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build

}

package_python2-pathlib2() {
  depends=('python2' 'python2-scandir')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pathlib2() {
  depends=('python' 'python-scandir')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

